<?php
	printf('<div class="meta_head">%s</div>', __d('lil_blogs', 'POST DETAILS', true));
	
	printf(
		'<div class="meta_date">' . __d('lil_blogs', 'Posted on %s', true) . '</div>',
		$this->Time->format($post['Post']['created'])
	);
	printf(
		'<div class="meta_author">' . __d('lil_blogs', 'Written by %s', true) . '</div>',
		$this->Html->clean($post['Author'][Configure::read('Lil.userDisplayField')])
	);
	
	printf(
		'<div class="meta_comment_count">' . __d('lil_blogs', 'Number of Comments %s', true) . '</div>',
		$this->Html->link(
			$post['Post']['no_comments'],
			array(
				'plugin'     => 'lil_blogs',
				'controller' => 'posts',
				'action'     => 'view',
				'blog'       => $blog['Blog'][Configure::read('Lil.areaSlugField')],
				'post'       => $post['Post']['slug'] . '#comments'
			)
		)
	);
	
	// display list of categories
	if (!empty($post['Category'])) {
		printf(
			'<div class="meta_categories">' . __d('lil_blogs', 'Posted in %s', true) . '</div>',
			$this->Text->toList(
				Set::format(
					$post,
					$this->Html->link('%1$s', array(
						'controller' => 'posts',
						'action'     => 'index',
						'blog'       => $blog['Blog'][Configure::read('Lil.areaSlugField')],
						'category'   => '%2$s'
					)),
					array('Category.{n}.name', 'Category.{n}.id')
				),
				__d('lil_blogs', 'and', true)
			)
		);
	}

	// show "edit this post" link
	if ($Auth['User']['id']) {
		printf(
			'<div class="meta_admin_edit">' .
			$this->Html->link(
				__d('lil_blogs', 'Edit this post', true),
				array(
					'admin'      => true,
					'plugin'     => 'lil_blogs',
					'controller' => 'posts',
					'action'     => 'edit',
					'area_id'    => $post['Blog']['id'],
					$post['Post']['id']
				)
			) .
			'</div>'
		);
	}
?>